package org.rugby.online.impl;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import java.util.Locale;

import org.junit.Before;
import org.junit.Test;
import org.rugby.online.core.humans.RboProfession;
import org.rugby.online.impl.DefaultNonPlayer;

public class DefaultNonPlayerTest {

	private DefaultNonPlayer nonPlayer;
	
	@Before
	public void setUp() throws Exception {
		nonPlayer = new DefaultNonPlayer(RboProfession.MANAGEMENT_MAIN, Locale.FRENCH);
		nonPlayer.setAge((short) 25);
	}

	@Test
	public void testGetProfession() {
		assertTrue(nonPlayer.getProfession().equals(RboProfession.MANAGEMENT_MAIN));
	}

	@Test
	public void testGetSkillMap() {
		assertNotNull(nonPlayer.getSkillMap());
		assertTrue(nonPlayer.getSkillMap().size() == 1);
	}

	@Test
	public void testGetFirstName() {
		assertNotNull(nonPlayer.getName());
	}

	@Test
	public void testGetAge() {
		assertTrue(nonPlayer.getAge() >= 18);
		assertTrue(nonPlayer.getAge() <= 68);
	}

	@Test
	public void testPopUpAge() {
		short age = nonPlayer.getAge();
		 nonPlayer.popUpAge();
		short newAge = nonPlayer.getAge();
		assertTrue((newAge - age) == 1);
	}

	@Test
	public void testGetName() {
		assertNotNull(nonPlayer.getName());
	}

	@Test
	public void testGetId() {
		assertNotNull(nonPlayer.getId());
	}

}
